package me.zhengjie.business.service.impl;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.business.domain.vo.Kc22Vo;
import me.zhengjie.business.domain.vo.Kc24Vo;
import me.zhengjie.business.repository.Kc22Repository;
import me.zhengjie.business.repository.Kc24Repository;
import me.zhengjie.business.service.Kc22Service;
import me.zhengjie.business.service.Kc24Service;
import me.zhengjie.business.service.dto.Kc22QueryCriteria;
import me.zhengjie.business.service.dto.Kc24QueryCriteria;
import me.zhengjie.utils.PageUtil;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @description 服务实现
 * @author xiahongbo
 * @date 2023-05-10
 **/
@Slf4j
@Service
@RequiredArgsConstructor
public class Kc24ServiceImpl implements Kc24Service {

    private final Kc24Repository kc24Repository;
    @Override
    public Map<String, Object> queryKc24VoPageList(Kc24QueryCriteria criteria, Pageable pageable) {
        Page<Kc24Vo> page = kc24Repository.queryKc24VoPageList(criteria.getAkc190(), criteria.getAac001(), criteria.getAac003(), criteria.getAkb020(), pageable);
        return PageUtil.toPage(page);
    }


    @Override
    public List<Kc24Vo> queryKc24VoAllList(Kc24QueryCriteria criteria) {
        return kc24Repository.queryKc24VoAllList(criteria.getAkc190(), criteria.getAac001(), criteria.getAac003(), criteria.getAkb020());
    }

    @Override
    public void download(List<Kc24Vo> all, HttpServletResponse response) throws IOException {

    }
}
